gitHub 的 SSH key 設定


Posted by estella00911 on 2022-05-22

1. 開啟 github setting

1.1 打開 setting

1.2 SSH key

2. 新增 SSH key 至 gitHub

2.1 尋找/新增 ~/.ssh/ 內的 public key

尋找 public key 裡面的 text,並使用 cat 印出來,貼到 gitHub 的 add new SSH key 上。

2.1.1 尋找 ~/.ssh 內的 public key

> cd 
> cd .ssh
> ls
> id_rsa id_rsa.pub
> cat id_rsa.pub

印出 id_rsa.pub 的 ssh key 之後,回到 gitHub 上,新增 SSH key 至 gitHub 上。

2.1.2 新增 ssh key

在 command line 上,先找到新增檔案的資料夾位置

> cd
> cd .ssh
> pwd # 查看路徑
> /Users/jeanlu/.ssh

使用 CLI generate SSH key

ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/jeanlu/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/jeanlu/.ssh/id_ed25519
Your public key has been saved in /Users/jeanlu/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx jeanlu@Jeans-macBook.local
The key's randomart image is:
+--[ED25519 256]--+
|oE.=..oo         |
|=.+ =oo ..       |
| O.B o o* +      |
|=.B * o+ = .     |
|.+ + +  S        |
|  + o...         |
|  ...o..         |
|   o. o..        |
|    o+. ..       |
+----[SHA256]-----+

新增好 key 之後,查看一下名稱,並複製到 gitHub 的 add new SSH key 上

> ls
> id_ed25519.pub id_ed25519

3.1 移動到新的 repository


#ssh #Github







Related Posts

226. Invert Binary Tree

226. Invert Binary Tree

How to Set Up Firewall with UFW on Ubuntu 20.04

How to Set Up Firewall with UFW on Ubuntu 20.04

解題 - 找出所有等腰三角形

解題 - 找出所有等腰三角形


Comments